def item = request.getString('item');
def id = request.getLong('ID');
def content = request.getString('content');

//合法性校验
def detail = db.find("select * from DIARY where ID = ?",id);
if(!detail){
  nami.error("日记不存在");
}

//添加日记内容
def sql = "update DIARY set " + item + " = '" + content + "' where ID = " + id;
log.debug("sql:{}",sql);
db.exec(sql);
return true;